package com.yjd.comm.merchant.enums;

/**
 * Created by yjd-wap on 2017/10/25.
 */
public enum MerchantFundsTypeEnum {

    UNKNOWN(0, "未知"),
    ORDER_IN(1, "订单"),
    ORDER_OUT(2, "退单"),
    REPAYMENT(3,"还款"),
    SERVICE_FEE(4,"服务手续费"),
    OVERDUE(5,"罚息"),
    OVERDUE_FEE(6,"催收服务费"),
    CASH(7,"提现");

    private int code;
    private String label;

    public static MerchantFundsTypeEnum parse(int code){
        for (MerchantFundsTypeEnum fundsTypeEnum : MerchantFundsTypeEnum.values()) {
            if(fundsTypeEnum.getCode() == code){
                return fundsTypeEnum;
            }
        }
        return null;
    }

    private MerchantFundsTypeEnum(int code, String label) {
        this.code = code;
        this.label = label;
    }

    public int getCode() {
        return code;
    }
    public void setCode(int code) {
        this.code = code;
    }
    public String getLabel() {
        return label;
    }
    public void setLabel(String label) {
        this.label = label;
    }
}
